package com.dwxt.parabolic.controller;

import com.dwxt.common.base.BaseResult;
import com.dwxt.common.base.Page;
import com.dwxt.parabolic.entity.Camera;
import com.dwxt.parabolic.service.CameraService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/parabolic/camera")
@RestController
public class CameraController {

    @Autowired
    private CameraService cameraService;

    /**
     * 条件查询相机
     */
    @RequestMapping("/list")
    public BaseResult getCameraList(Camera camera, Page page) {
        return cameraService.getCameraList(camera, page);
    }

    /**
     * 新增相机
     */
    @RequestMapping("/add")
    public BaseResult add(Camera camera) {
        return cameraService.add(camera);
    }

    /**
     * 修改相机
     */
    @RequestMapping("/update")
    public BaseResult update(Camera camera) {
        return cameraService.update(camera);
    }

    /**
     * 删除相机
     */
    @RequestMapping("/delete")
    public BaseResult delete(String id) {
        return cameraService.delete(id);
    }

    /**
     * 启动或关闭相机
     */
    @RequestMapping("/startOrEnd")
    public BaseResult startOrEnd(String id){
        return cameraService.startOrEnd(id);
    }

    /**********************************超脑调用接口**********************************************/

   /* @RequestMapping("/list/all")
    public BaseResult getAllCameraOfDevice(String deviceId) {
        return cameraService.selectAllCameraOfDevice(deviceId);
    }*/

}
